<%@page import="java.math.BigDecimal"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="bit.util.ConnectionContext"%>
<%@page import="java.sql.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="reqCharEnc.jsp" %>
<%@ include file="preventCache.jsp" %>
<%
BigDecimal idx = new BigDecimal(request.getParameter("idx"));
%>
<%
// Connection
Connection conn = ConnectionContext.getConnection();
// SQL Query
String sql = "SELECT * FROM member_info WHERE idx = ?";
// prepare statement
PreparedStatement pstmt = conn.prepareStatement(sql);

pstmt.setBigDecimal(1, idx);

// execute
ResultSet rs = pstmt.executeQuery();
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>회원 정보 조회</title>
<link rel="stylesheet"
	type="text/css"
	href="<%= application.getContextPath() %>/style/main.css" />
</head>
<body>
<%
int count = 0;
while (rs.next()) {
	count ++;
%>
	<table>
		<tr>
			<th>아이디</th>
			<td><%= rs.getString("login_id") %></td>
		</tr>
		<tr>
			<th>이름</th>
			<td><%= rs.getString("name") %></td>
		</tr>
		<tr>
			<th>이메일</th>
			<td><%= rs.getString("email") %></td>
		</tr>
		<tr>
			<th>전화번호</th>
			<td><%= rs.getString("tel_no") %></td>
		</tr>
	</table>
<%
}

if (count < 1) {
%>
	존재하지 않는 회원입니다.
<%
}
%>
<br/>
<input type="button" value="회원 목록으로 돌아가기" onclick="location.href='members.jsp';" />

</body>
</html>